package mm.apk.libmm.exts

import android.content.Context
import android.view.inputmethod.InputMethodManager

/**
 * Descriptions：Context 扩展
 * StartVersion：
 * <p>
 * Author：ChenME
 * Date：2019-11-15
 * Email：ibelieve1210@163.com
 */
/**
 * App版本 name
 * @return
 */
fun Context.appVersionName(): String = packageManager.getPackageInfo(packageName, 0)?.versionName ?: ""

/**
 * App版本 code
 * @return
 */
fun Context.appVersionCode(): Int = packageManager.getPackageInfo(packageName, 0)?.versionCode ?: 1


/**
 * 获取 InputMethodManager
 */
val Context.inputMethodManager: InputMethodManager?
    get() = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager